home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / extras / Direct3D / Tools / 3DSMax4 / meshdata.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-08  |  2.9 KB  |  126 lines

  1. //-----------------------------------------------------------------------------
  2. // File: MeshData.h
  3. //
  4. // Desc: Structures to store a reformated mesh in (split vertices, etc)
  5. //
  6. // Copyright (C) 1998-2000 Microsoft Corporation. All Rights Reserved.
  7. //-----------------------------------------------------------------------------
  8. #ifndef __MESHDATA_H__
  9. #define __MESHDATA_H__
  10.  
  11. // ================================================== CVertexNode
  12. // Node for a data stucture what will help expand an array of vertices
  13. // into a list of vertices each of which may have more than one normal based
  14. // on the smoothing groups that the vertex belongs to.  This new expanded
  15. // list of vertices (with duplicated verts) will be what gets exported out.
  16. struct SVertexData
  17. {
  18.     Point3 vNormal;
  19.     DWORD iPointRep; // index not including duplicated vertices (raw vertex index)
  20.     DWORD iWedgeList; // index to next vertex in a list of vertices 
  21.  
  22.     DWORD iTextureIndex;
  23.     DWORD iSmoothingGroupIndex;
  24.     DWORD iMaterial;
  25. };
  26.  
  27. // ================================================== CFaceData
  28. struct SFaceData
  29. {
  30.     DWORD index[3];
  31. };
  32.  
  33. struct SMeshData
  34. {
  35.     SMeshData()
  36.         :m_rgVertices(NULL), m_rgFaces(NULL) {}
  37.  
  38.     ~SMeshData()
  39.     {
  40.         delete []m_rgVertices;
  41.         delete []m_rgFaces;
  42.     }
  43.  
  44.     BOOL m_bTexCoordsPresent;
  45.     DWORD m_cFaces;
  46.     DWORD m_cVertices;
  47.     DWORD m_cVerticesBeforeDuplication;
  48.  
  49.     SVertexData *m_rgVertices;
  50.     SFaceData *m_rgFaces;
  51.  
  52. };
  53.  
  54. HRESULT GenerateMeshData
  55.     (
  56.     Mesh *pMesh,
  57.     SMeshData *pMeshData,
  58.     DWORD *rgdwMeshMaterials
  59.     );
  60.  
  61. struct SPatchVertexData
  62. {
  63.     Point3 vPosition;
  64.     DWORD iPointRep; // index not including duplicated vertices (raw vertex index)
  65.     DWORD iWedgeList; // index to next vertex in a list of vertices 
  66.  
  67.     DWORD iTextureIndex;
  68. };
  69.  
  70. struct SPatchData
  71. {
  72.     DWORD m_cControl;
  73.     DWORD m_rgdwControl[16];
  74. };
  75.  
  76. struct SPatchMeshData
  77. {
  78.     SPatchMeshData()
  79.         :m_rgVertices(NULL), m_rgPatches(NULL) {}
  80.  
  81.     ~SPatchMeshData()
  82.     {
  83.         delete []m_rgVertices;
  84.         delete []m_rgPatches;
  85.     }
  86.  
  87.     BOOL m_bTexCoordsPresent;
  88.     DWORD m_cPatches;
  89.     DWORD m_cVertices;
  90.     DWORD m_cVerticesBeforeDuplication;
  91.  
  92.     SPatchVertexData *m_rgVertices;
  93.     SPatchData *m_rgPatches;
  94. };
  95.  
  96. HRESULT GeneratePatchMeshData
  97.     (
  98.     PatchMesh *pPatchMesh,
  99.     SPatchMeshData *pPatchMeshData 
  100.     );
  101.  
  102. enum 
  103.     bmtex_clipu,bmtex_clipv,bmtex_clipw,bmtex_cliph,
  104.     bmtex_jitter,bmtex_usejitter,
  105.     bmtex_apply,bmtex_crop_place,
  106.     bmtex_filtering,
  107.     bmtex_monooutput,
  108.     bmtex_rgboutput,
  109.     bmtex_alphasource,
  110.     bmtex_premultalpha,
  111.     bmtex_bitmap,
  112.     bmtex_coords,     // access for UVW mapping
  113.     bmtex_output,     //output window
  114.     bmtex_filename   // bitmap filename virtual parameter, JBW 2/23/99
  115. };
  116.  
  117. struct SCropInfo
  118. {
  119.     float fClipU;
  120.     float fClipV;
  121.     float fClipW;
  122.     float fClipH;
  123. };
  124.  
  125. #endif // __MESHDATA_H__